package manager;

import java.util.List;

import idao.IReviewsDAO;
import imanager.IReviewsManager;
import model.Reviews;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class ReviewsManager implements IReviewsManager {

	@Autowired
	private IReviewsDAO reviewsDAO;

	public IReviewsDAO getReviewsDAO() {
		return reviewsDAO;
	}

	public void setReviewsDAO(IReviewsDAO reviewsDAO) {
		this.reviewsDAO = reviewsDAO;
	}
	
	public ReviewsManager() {
		// TODO Auto-generated constructor stub
	}

	@Transactional
	public boolean insert(Reviews reviews) {
		// TODO Auto-generated method stub
		return false;
	}

	@Transactional
	public boolean update(Reviews reviews) {
		// TODO Auto-generated method stub
		return reviewsDAO.insert(reviews);
	}

	@Transactional
	public boolean delete(Reviews reviews) {
		// TODO Auto-generated method stub
		return reviewsDAO.delete(reviews);
	}

	@Transactional
	public Reviews getReviewByID(int id) {
		// TODO Auto-generated method stub
		return reviewsDAO.getReviewByID(id);
	}

	@Transactional
	public List<Reviews> getAll() {
		// TODO Auto-generated method stub
		return reviewsDAO.getAll();
	}

}
